package com.coolxiaoyao.test.controller;

import com.coolxiaoyao.common.annotation.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.Map;

/**
 * @author Kerry on 18/09/20
 */

@RestController("/m")
public class ManagerController {

    private static Logger logger = LoggerFactory.getLogger(ManagerController.class);


    @GetMapping("/login")
    public Object login(@RequestParam(value = "key", defaultValue = "12") Long key) {
        logger.debug("ManagerController.login. key = {}", key);
        return "loginSuccess";
    }


    @GetMapping("/listStringArray")
    @PostMapping("/listStringArray")
    public Object listStringArray(@RequestParam("key") Integer[] key) {

        System.out.println(key.length);
        for (Integer s : key) {
            logger.debug("ManagerController.listStringArray. key = {}", s);
        }
        return "loginSuccess";
    }

    @GetMapping("/arrayList")
    public Object arrayList(@RequestParam("key") List<String> key) {
        logger.debug("ManagerController.arrayList. size  = {}", key.size());
        for (String o : key) {
            logger.debug("ManagerController.arrayList. key = {}", o);
        }
        return "loginSuccess";
    }


    @GetMapping("/listString")
    public Object abc(@RequestParam("key") String key) {
        logger.debug("ManagerController.login. key = [{}]", key);
        return "loginSuccess";
    }



}
